<cfoutput>
	<!--- *** OUTPUTTING THE LIST *** --->
	<!--- *** POPULATE BY LIST FIRST *** --->
	<cfset excludes = excludes & ",id"/>
	<cfif structKeyExists(config,'value') and not structKeyExists(config,'query')>
		<cfset config.value = parent.exists(config.value,caller,false)/>
		<cfset config.value = evaluate(config.value)/>
<input type="#tag#"#parent.getFieldAttributes(attributes,excludes)# value="#config.value#" id="#attributes.id#"<cfif config.checkedValue eq config.value> checked="checked"</cfif>/>

	<cfelseif structKeyExists(config,'list')>
		<cfset config.list = evaluate(config.list)/>
		<cfset length = listLen(config.list,config.delimiters)/>
		<cfset isSpan = config.size neq 0 and length gt config.size/>
		<cfset i = 0/>	
		<cfloop list="#config.list#" index="element" delimiters="#config.delimiters#">
			<cfset i = i + 1/>
			<!--- Opening the span tag --->
			<cfif isSpan and not nospan>
				<cfset col = i mod config.size/>
<span class="<cfif i neq 1><cfif not col>#config['class#tag##config.size#']#<cfelse>#config['class#tag##col#']#</cfif><cfelse>#tag#First</cfif>">
			</cfif>

			<cfset key = trim(listFirst(element,config.valueDelimiters))/>
<input type="#tag#"#parent.getFieldAttributes(attributes,excludes)# value="#key#" id="#attributes.id#_#key#"<cfif listFindNoCase(config.checkedValue,key)> checked="checked"</cfif>/><label for="#config.forLabel#_#key#">#trim(listLast(element,config.valueDelimiters))#</label>

			<!--- Closing the span tag --->
<cfif isSpan and not nospan></span><cfif not col  and (length neq i)><br/></cfif></cfif><cfif nospan><br/></cfif>
		</cfloop>


	<!--- *** POPULATE BY VALUELIST AND OPTIONLIST *** --->
	<cfelseif structKeyExists(config,'valueList')>
		<cfset length = listLen(config.valueList,config.valueDelimiters)/>
		<cfset isSpan = config.size neq 0 and length gt config.size/>

		<cfloop from="1" to="#length#" index="i">
			<!--- Opening the span tag --->
			<cfif isSpan and not nospan>
				<cfset col = i mod config.size/>
<span class="<cfif i neq 1><cfif not col>#config['class#tag##config.size#']#<cfelse>#config['class#tag##col#']#</cfif><cfelse>#tag#First</cfif>">
			</cfif>

			<cfset key = trim(listGetAt(config.valueList,i,config.valueDelimiters))/>
<input type="#tag#"#parent.getFieldAttributes(attributes,excludes)# value="#key#" id="#attributes.id#_#key#"<cfif listFindNoCase(config.checkedValue,key)> checked="checked"</cfif>/>
<label for="#config.forLabel#_#key#">#trim(listGetAt(config.optionList,i,config.delimiters))#</label>

			<!--- Closing the span tag --->
<cfif isSpan and not nospan></span><cfif not col  and (length neq i)><br/></cfif></cfif><cfif nospan><br/></cfif>
		</cfloop>

	<!--- *** POPULATE BY ARRAY *** --->
	<cfelseif structKeyExists(config,'array')>
		<cfset length = arrayLen(config.array)/>
		<cfset isSpan = config.size neq 0 and length gt config.size/>

		<cfloop from="1" to="#length#" index="i">
			<!--- Opening the span tag --->
			<cfif isSpan and not nospan>
				<cfset col = i mod config.size/>
<span class="<cfif i neq 1><cfif not col>#config['class#tag##config.size#']#<cfelse>#config['class#tag##col#']#</cfif><cfelse>#tag#First</cfif>">
			</cfif>

			<cfset key = trim(config.array[i])/>
<input type="#tag#"#parent.getFieldAttributes(attributes,excludes)# value="#key#" id="#attributes.id#_#key#"<cfif listFindNoCase(config.checkedValue,key)> checked="checked"</cfif>/><label for="#config.forLabel#_#key#">#key#</label>

			<!--- Closing the span tag --->
			<cfif isSpan and not nospan></span><cfif not col  and (length neq i)><br/></cfif></cfif><cfif nospan><br/></cfif>
		</cfloop>


	<!--- *** POPULATE BY VALUEARRAY AND OPTIONARRAY *** --->
	<cfelseif structKeyExists(config,'valueArray')>
		<cfset length = arrayLen(config.valueArray)/>
		<cfset isSpan = config.size neq 0 and length gt config.size/>

		<cfloop from="1" to="#length#" index="i">
			<!--- Opening the span tag --->
			<cfif isSpan and not nospan>
				<cfset col = i mod config.size/>
<span class="<cfif i neq 1><cfif not col>#config['class#tag##config.size#']#<cfelse>#config['class#tag##col#']#</cfif><cfelse>#tag#First</cfif>">
			</cfif>
			<cfset key = trim(config.valueArray[i])/>
<input type="#tag#"#parent.getFieldAttributes(attributes,excludes)# value="#key#" id="#attributes.id#_#key#"<cfif listFindNoCase(config.checkedValue,key)> checked="checked"</cfif>/><label for="#config.forLabel#_#key#">#trim(config.optionArray[i])#</label>

			<!--- Closing the span tag --->
			<cfif isSpan and not nospan></span><cfif not col  and (length neq i)><br/></cfif></cfif><cfif nospan><br/></cfif>
		</cfloop>


	<!--- *** POPULATE BY QUERY *** --->
	<cfelseif structKeyExists(config,'query')>
		<cfset noEval =listlen(config.value,'&') eq 1 AND listLen(config.option,'&') eq 1/>
		<cfset isSpan = config.size neq 0 and config.query.recordcount gt config.size/>

		<!--- Loop over the query --->
		<cfloop query="config.query">
			<!--- Opening the span tag --->
			<cfif isSpan and not nospan>
				<cfset col = config.query.currentRow mod config.size/>
<span class="<cfif config.query.currentRow neq 1><cfif not col>#config['class#tag##config.size#']#<cfelse>#config['class#tag##col#']#</cfif><cfelse>#tag#First</cfif>">
			</cfif>

			<!--- No need to use evaluate() --->
			<cfif noEval>
				<cfset value = trim(config.query[trim(config.value)][config.query.currentRow])/>
<input type="#tag#"#parent.getFieldAttributes(attributes,excludes)# value="#value#" id="#attributes.id#_#value#"<cfif listFindNoCase(config.checkedValue,value)> checked="checked"</cfif>/><label for="#config.forLabel#_#value#">#trim(config.query[trim(config.option)][config.query.currentRow])#</label>

			<!--- Need to use evaluate() --->
			<cfelse>
				<cfset value = trim(evaluate(config.value))/>
<input type="#tag#"#parent.getFieldAttributes(attributes,excludes)# value="#value#" id="#attributes.id#_#value#"<cfif listFindNoCase(config.checkedValue,value)> checked="checked"</cfif>/><label for="#config.forLabel#_#value#">#trim(evaluate(config.option))#</label>
			</cfif>

			<!--- Closing the span tag --->
			<cfif isSpan and not nospan></span><cfif not col and (config.query.recordcount neq config.query.currentrow)><br/></cfif></cfif><cfif nospan><br/></cfif>
		</cfloop>
	</cfif>

	<!--- *** DONE POPULATING *** --->
</cfoutput>